const axios = require("axios");
const schedule = require("node-schedule");

// 每天的下午5点20分会执行
schedule.scheduleJob({ hour: 17, minute: 20 }, () => {
  getLoveTalk();
});

schedule.scheduleJob('52 * * * * *', function(){
  getLoveTalk();
}); 

function getLoveTalk() {
  const url = "https://chp.shadiao.app/api.php"; // 情话api
  axios.get(url).then((res) => {
    sendMsg(res.data);
  })
}

function sendMsg(msg) {
  axios({
    method: "POST",
    url: "https://sc.ftqq.com/这里输入你的sckey.send",
    params: {
      text: "我想对你说的呀...", // 自己的标题
      desp: msg // 内容
    }
  })
}